home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_1 / pubdom.tar / pubdom / trent / angd next >
Text File  |  1990-06-02  |  688b  |  26 lines

  1. %%HP: T(3)A(D)F(.);         @ ANGD   Converts HMS angle to formatted string
  2. \<<
  3.  
  4.  \<< + 
  5. DUP SIZE  
  6. 3
  7.   IF <
  8.   THEN "0" SWAP +
  9.   END + 
  10.  \>>  \-> zro \<<
  11.  HMS\-> 360 MOD \->HMS   
  12. 4 RND HMS\-> \->HMS STD     @ Make sure rounding is accurate
  13.  
  14. DUP DUP IP \->STR "\^o"     @ Get degrees
  15. + SWAP FP 100 * IP
  16. \->STR "'"                  @ Get minutes
  17. zro EVAL 
  18. SWAP 100 *
  19. FP 100 * IP \->STR 34       @ Get seconds
  20. CHR zro EVAL
  21. \>>                         @ Leaves String with degree, minutes, and second
  22.                             @ marks on the stack.
  23.  
  24.                             @ developed by Kenneth Trent for SMI
  25.                             @ (615) 246-3790
  26. \>>